package com.topfun.dao;

import com.topfun.utils.JDBCUtil;
import com.topfun.vo.MarketRecord;

/**
 * Created by huangda on 2017/8/23.
 * 交易记录dao
 */
public class MarketRecordDao {
    // ===========================================================
    // Constants
    // ===========================================================
    private static final String SQL_INSERT_MARKET_RECORD;
    static {
        SQL_INSERT_MARKET_RECORD = "insert into topfun.market_record (userId,preAmount,amount,afterAmount,type,status,description,marketTime) values (?,?,?,?,?,?,?,?)";
    }
    // ===========================================================
    // Fields
    // ===========================================================

    // ===========================================================
    // Constructors
    // ===========================================================

    // ===========================================================
    // Getter &amp; Setter
    // ===========================================================

    // ===========================================================
    // Methods for/from SuperClass/Interfaces
    // ===========================================================

    // ===========================================================
    // Methods
    // ===========================================================
    public static void insertMarketRecord(MarketRecord pMarketRecord) {
        JDBCUtil.insertForPrimaryKey(SQL_INSERT_MARKET_RECORD,new Object[]{
                //userId,preAmount,amount,
                pMarketRecord.userId,pMarketRecord.preAmount,pMarketRecord.amount,
                //afterAmount,type,status
                pMarketRecord.afterAmount,pMarketRecord.type,pMarketRecord.status,
                //description,marketTime
                pMarketRecord.description,pMarketRecord.marketTime
        });
    }

    // ===========================================================
    // Inner and Anonymous Classes
    // ===========================================================
}
